import cn.hutool.core.date.DateUtil;
import pers.cz.mapper.AutoCollectTestCaseSqlMapper;
import pers.cz.model.AutoCollectTestCaseSql;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.testng.annotations.Test;

/**
 * @program: PostGirl-panent
 * @description: InsertDB
 * @author: Cheng Zhi
 * @create: 2022-02-22 10:50
 **/
@SpringBootTest
public class InsertDB {

    @Autowired
    AutoCollectTestCaseSqlMapper autoCollectTestCaseSqlMapper;

    @Test
    public void test1() {

        for (int i=0; i<10; i++) {

            AutoCollectTestCaseSql autoCollectTestCaseSql = new AutoCollectTestCaseSql();
            autoCollectTestCaseSql.setRunSql("select * from a");
            autoCollectTestCaseSql.setBusiCode("78" + i);
            autoCollectTestCaseSql.setRunTime(String.valueOf(System.currentTimeMillis()));
            autoCollectTestCaseSql.setSyncTime(DateUtil.date());

            autoCollectTestCaseSqlMapper.insert(autoCollectTestCaseSql);
        }
    }

}
